CC = gcc 
CLIB = -L/usr/lib64/mysql -lmysqlclient -lm -lpthread
#CLIB = $(mysql_config --libs) -lmysqlclient -lm -lpthread
CFLAGS = -O -Wall $(mysql_config --cflags)
TARGET = vehicle daemon
OBJECT = main.o termlMsg_analy.o msg_assem.o termlMsg_handle.o platfMsg_analy.o platfMsg_handle.o mysql_fun.o db_dat.o  server.o re_chck.o link.o 
#CFILE = main.c termlMsg_analy.c msg_assem.c termlMsg_handle.c platfMsg_analy.c platfMsg_handle.c mysql_fun.c db_dat.c  server.c re_chck.c link.c

%.o : %.c
	$(CC) $(CFLAGS) -c -o $@ $<

all: $(TARGET)

vehicle : $(OBJECT)
	$(CC) -o $@ $? $(CLIB)
daemon : daemon.o
	$(CC) -o $@ $? $(CLIB)

clean:
	rm -rf $(TARGET) *.o
